﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms; 
using CourseArraging.UControl; 
using System.ComponentModel;
using System.Drawing;
using Stone.DataContracts;

namespace CourseArraging.Frm.jcxx
{
    /// <summary>
    /// 版权所有
    /// 石世特@温州医学院 sst330381@gmail.com
    /// </summary> 
    public class FrmDepitem : FrmControlBase
    {
        // Fields
        private IContainer components;

        // Methods
        public FrmDepitem()
        {
            this.components = null;
            this.InitializeComponent();
        }

        public FrmDepitem(string tmpno)
        {
            this.components = null;
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public override object GetEntity(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return null;
            }
            DataGridView view = (DataGridView)sender;
            DepEntity entity = new DepEntity();
            entity.dep_info_id = int.Parse(view.Rows[e.RowIndex].Cells["编号"].Value.ToString());
            entity.dep_info_name = view.Rows[e.RowIndex].Cells["分校"].Value.ToString();
            entity.dep_info_address = view.Rows[e.RowIndex].Cells["地址"].Value.ToString();
            entity.dep_info_phone = view.Rows[e.RowIndex].Cells["电话"].Value.ToString();
            return entity;
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x2b6, 0x94);
            base.Name = "FrmDepitem";
            base.ResumeLayout(false);
            base.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }

        public override void ShowData(string tmpno,string time)
        {
            base.dataGridView1.DataSource = this.basicdao.getDepinfo4table(0,null,null,null);
            base.dataGridView1.Columns["编号"].Visible = false;
        }
    }

 

}
